# docker build -t face:v1.0 .
# docker-compose -f docker-compose-face.yml up -d
# docker-compose -f docker-compose-face.yml down
FROM  face:base-python3.10-amd64-20250506

ENV TZ=Asia/Shanghai
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get clean all && apt-get update -y

# 安装运维工具
RUN apt install -y --force-yes --fix-missing --no-install-recommends apt-utils ca-certificates software-properties-common vim rsync wget curl locales zip unzip python3-opencv

RUN mkdir -p /var/log/supervisor && apt install -y supervisor

# 安装字体
RUN apt install -y --force-yes --no-install-recommends locales ttf-wqy-microhei ttf-wqy-zenhei xfonts-wqy && locale-gen zh_CN && locale-gen zh_CN.utf8
ENV LANG zh_CN.UTF-8
ENV LC_ALL zh_CN.UTF-8
ENV LANGUAGE zh_CN.UTF-8

# 便捷操作
RUN echo "alias ll='ls -alF'" >> /etc/profile && \
	echo "alias la='ls -A'" >> /etc/profile && \
	echo "alias vi='vim'" >> /etc/profile

COPY requirements.txt /requirements.txt

RUN pip install --upgrade setuptools pip && \
    pip install --ignore-installed -r /requirements.txt && \
    rm -rf /root/.cache/pip
# 创建工作目录
WORKDIR /app

# 复制整个项目目录到容器中
COPY . .
RUN echo  /app/seetaface/lib/ubuntu  > /etc/ld.so.conf.d/seetaface6.conf && \
    ldconfig
# 暴露 8000 端口
EXPOSE 8000

# 运行 uvicorn 服务
CMD ["python3", "main.py"]